import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: ()=>import('../components/Login')
    },
    {
      //俘虏有
      path : "/main",
      name:'Main',
      components: {
        'default': ()=>import("../components/MainD")
      },

      children:[
        {
          path: '/roles',
          name: 'rolesManager',
          component:()=>import("../components/base/RoleManager"),
          roles: ['3','2']
        },
        {
          path: '/books',
          name: 'booksManager',
          components: {
            'default': () => import('../components/book/BooksManager')
          }
        },
        {
          path: '/activity',
          name: 'activityManager',
          components: {
            'default': () => import('../components/book/ActivityManager')
          }
        },
        {
          path: '/user',
          name: 'UserManager',
          components: {
            'default': () => import('../components/base/UserManager')
          }
        },

        {
          path: '/userSelf',
          name: 'UserSelfManager',
          components: {
            'default': () => import('../components/base/UserSelf')
          }
        },
        {
          path: '/bookt',
          name: 'booksTest',
          components: {
            'default': () => import('../components/book/BookTest')
          }
        },
        {
          path: '/adu',
          name: 'testAdu',
          components: {
            'default': () => import('../components/base/TestADU')
          }
        },
        {
          path: '/texture',
          name: 'textureManager',
          components: {
            'default': () => import('../components/book/TextureManager')
          }
        },
        {
          path: '/fuser',
          name: 'fuserManager',
          components: {
            'default': () => import('../components/base/FuserManager')
          }
        },
        {
            path: '/inventory',
            name: 'inventoryManager',
            components: {
               'default': () => import('../components/Inventory')
            }
         },
        {
          path: '/author',
          name: 'authorManager',
          components: {
            'default': () => import('../components/book/AuthorManager')
          }
        },
        {
          path: '/type',
          name: 'typeManager',
          components: {
            'default': () => import('../components/book/Type')
          }
        },
        {
          path: '/tu',
          name: 'TestUser',
          components: {
            'default': () => import('../components/base/TestUser')
          }
        },

        {
          path: '/publisher',
          name: 'publisherManager',
          components: {
            'default': () => import('../components/book/PublisherManager')
          }
        },
        {
          path: '/turnover',
          name: 'turnoverManager',
          components: {
            'default': () => import('../components/turnover/TurnoverManager')
          }
        },
        {
          path: '/turnovers',
          name: 'turnoversManager',
          components: {
            'default': () => import('../components/turnover/TurnoversManager')
          }
        },
        {
          path: '/turnoveru',
          name: 'turnoveruManager',
          components: {
            'default': () => import('../components/turnover/TurnoveruManger')
          }
        },
        {
          path:'/applyPost',
          name:'applyPostManager',
          components: {
            'default': () => import('../components/apply/ApplyPostManager')
          }
        },
        {
          path: '/applyBuy',
          name: 'applyBuyManager',
          components: {
            'default': () => import('../components/apply/ApplyBuyManager')
          }
        },
        {
          path: '/inventory',
          name: 'inventoryManager',
          components: {
            'default': () => import('../components/inventory/InventoryManager')
          }
        },
        {
          path: '/in1',
          name: 'in1',
          components: {
            'default': () => import('../components/inventory/In1')
          }
        },
        {
          path: '/forders',
          name: 'forders',
          components: {
            'default': () => import('../components/order/FOrderManager')
          }
        },
        {
          path: '/return',
          name: 'return',
          components: {
            'default': () => import('../components/order/FReturnManager')
          }
        },
        {
          path: '/fordera',
          name: 'fordera',
          components: {
            'default': () => import('../components/order/FOrderaManager')
          }
        },
        {
          path: '/in2',
          name: 'in2',
          components: {
            'default': () => import('../components/inventory/In2')
          }
        },
        {
          path:'/applyApprove',
          name:'applyApproveManager',
          components: {
            'default': () => import('../components/apply/ApplyApproveManager')
          }
        },
        {
          path:'/applyDate',
          name:'applyDateManager',
          components: {
            'default': () => import('../components/apply/ApplyDateManager')
          }
        },
        {
          path: '/menu',
          name: 'menuManager',
          components: {
            'default': () => import('../components/base/MenuManager')
          }
        },
        {
          path: '/login',
          name: 'login',
          components:{
            'default': ()=> import('../components/Login')
          }
        },
        {
          path: '/brand',
          name:'brand',
          components: {
            'default':()=>import('../components/book/BrandManager')
          }
        },
        {
          path: '/fsite',
          name:'fsite',
          components:{
            'default': ()=> import('../components/FSiteManager')
          }
        },
        {
          path: '/404',
          name: 'NotFound',
          meta: {
            title: 'Page not found',
            isLogin: false
          },
          component: () => import('../components/404')
        },
        // 所有未定义路由，全部重定向到404页，必须放在最后
        {
          path: '*',
          redirect: '/404'
        }

      ]
    }
  ]
})

// {
//   //父路由
//   path:'/main',
//     name:'Main',
//   component:()=>import("../components/Main"),
//   //子路由
//   children:[
//   {
//     path: 'book',
//     name: 'book',
//     component: Book
//   },{
//     path:'user',
//     name: 'user',
//     component:()=>import("../components/User")
//   },
//   {
//     path:'fuser',
//     name: 'fuser',
//     component:()=>import("../components/Fuser")
//   },
//   {
//     path:'order',
//     name: 'order',
//     component:()=>import("../components/Order")
//   },
//   {
//     path:'texture',
//     name:'texture',
//     component:()=>import("../components/Texture")
//   }
//
// ]
// }
